package edu.gatech.cs2340.group7.wheresmystuffapp.junit;



import junit.framework.TestCase;
//import static org.junit.Assert.*;
//import java.io.File;
//import java.io.IOException;

import edu.gatech.cs2340.group7.wheresmystuffapp.presenters.CreateAccountPresenter;

//import org.junit.Test;

/**
 * This tests the create account functionality
 * @author Sarah Hughes
 */
public class CreateAccountTestCase extends TestCase {
	CreateAccountPresenter create = new CreateAccountPresenter(null);
	/**
	 * tests that the account is created if the input is correct
	 */
	
	public void testCorrectInput() {
		assertTrue("Failed Correct Input Test", create.createAccount(
				"New Account1", "password", "password", "8908908900"));
	}
	
	/**
	 * tests that the account is not created if the password and re-entered password does not match
	 */

	public void testWrongPW() {
		assertFalse("Failed Wrong Password Test", create.createAccount(
				"New Account2", "password", "jarks", "8908908900"));
	}
	
	/**
	 * tests that the account is not created if the password and re-entered password does not match
	 */

	public void testWrongPW2() {
		assertFalse("Failed Wrong Password Test 2", create.createAccount(
				"New Account3", "password", "Password", "8908908900"));
	}
	
	/**
	 * tests that the account is not created if the email is already in the database
	 */

	public void testUsedEmail() {
		assertFalse("Failed Used Account Test", create.createAccount("user",
				"user", "password", "8908908900"));
	}
	
	/**
	 * tests that the account is not created if the phone number is too short
	 */

	public void testPhoneNoLengthl() {
		assertFalse("Failed Phone Lenth Test", create.createAccount(
				"New Account4", "password", "password", "564"));
	}

	/**
	 * tests that the account is not created if the phone number is too short
	 */
	
	public void testPhoneNoLengthl2() {
		assertFalse("Failed Phone Lenth Test 2", create.createAccount(
				"New Account5", "password", "password", "123456"));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull1() {
		assertFalse("Failed Null Test 1",
				create.createAccount(null, null, null, null));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull2() {
		assertFalse("Failed Null Test 2",
				create.createAccount("New Account6", null, null, null));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull3() {
		assertFalse("Failed Null Test 3",
				create.createAccount("New Account7", "password", null, null));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull4() {
		assertFalse("Failed Null Test 4",
				create.createAccount("New Account8", null, "password", null));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull5() {
		assertFalse("Failed Null Test 5", create.createAccount("New Account9",
				"password", "password", null));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull6() {
		assertFalse("Failed Null Test 6", create.createAccount(null,
				"password", "password", "1234567890"));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull7() {
		assertFalse("Failed Null Test 7",
				create.createAccount(null, null, "password", "1234567890"));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull8() {
		assertFalse("Failed Null Test 8",
				create.createAccount("NewAccount10", null, null, "1234567890"));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull9() {
		assertFalse("Failed Null Test 9", create.createAccount("NewAccount11",
				null, "password", "1234567890"));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull10() {
		assertFalse("Failed Null Test 10", create.createAccount("NewAccount12",
				"password", null, "1234567890"));
	}

	/**
	 * tests that the account is not created if there are nulls
	 */
	
	public void testNull11() {
		assertFalse("Failed Null Test 11",
				create.createAccount(null, null, null, "1234567890"));
	}

}
